home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SNIP0492.ARJ / BITOPS.C < prev    next >
Text File  |  1991-09-06  |  333b  |  14 lines

  1. /*
  2. **  Bit set, clear, and test operations
  3. **
  4. **  public domain snippet by Bob Stout
  5. */
  6.  
  7. typedef enum {ERROR = -1, FALSE, TRUE} LOGICAL;
  8.  
  9. #define BOOL(x) (!(!(x)))
  10.  
  11. #define BitSet(arg,posn) ((arg) | (1L << (posn)))
  12. #define BitClr(arg,posn) ((arg) & ~(1L << (posn)))
  13. #define BitTst(arg,posn) BOOL((arg) & (1L << (posn)))
  14.